package com.mxprojects.constructors
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class RollUpButton extends MovieClip
	{
		public var arrows:MovieClip;
		
		public function RollUpButton(){
			addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
			addEventListener(MouseEvent.ROLL_OUT, rollOut, false, 0, true);
			//buttonMode = true;
			
			//reset the arrows_mc since it goes squirly
			if(checkArrow()){
				arrows.gotoAndStop(1);
			}
		}
		
		public function rollUp():void {
			if(checkArrow()){
				arrows.gotoAndPlay("up");
			}
			MXP3.enableBoard();
		}
		
		public function rollDown():void {
			if(checkArrow()){
				arrows.gotoAndPlay("down");
			}
			MXP3.disableBoard();
		}
		
		private function rollOver(event:MouseEvent):void {
			gotoAndPlay("over");
		}
		
		private function rollOut(event:MouseEvent):void {
			gotoAndPlay("out");
		}
		
		private function checkArrow():Boolean {
			//some people might now want the arrow there, so see if it's there
			if(arrows != null){
				return true;
			}else{
				return false;
			}
		}

	}
}